package 接口回调;

public class Boss implements CallBackInterface {
    private Employee employee;

    public void setEmployee(Employee employee) {
        System.out.println("老板雇佣员工！");
        this.employee = employee;
        employee.setCallBackInterface(this);
    }

    public Employee getEmployee() {
        return employee;
    }

    public void bossAskedEmployeeToWork() {
        if (employee != null) {
            System.out.println("老板叫员工工作");
            employee.work();
        }
    }

    @Override
    public void callBack() {
        System.out.println("员工告诉老板我工作做完了！");
    }
}
